package com.example.mappers;


import com.example.data.leave.LeaveDO;
import org.springframework.jdbc.core.RowMapper;

import com.example.data.leave.Leave;
import java.sql.ResultSet;
import java.sql.SQLException;
public class LeaveRowMapper implements RowMapper<Leave> {
    @Override
    public Leave mapRow(ResultSet rs,int i) throws SQLException {
        Leave leaveDo = new LeaveDO();

        leaveDo.setAppID(rs.getLong("appId"));
        leaveDo.setEmpID(rs.getLong("empId"));
        leaveDo.setEmpName(rs.getString("empName"));
        leaveDo.setEmpDeptID(rs.getLong("empDeptId"));
        leaveDo.setEmpDeptName(rs.getString("empDeptName"));
        leaveDo.setReason(rs.getString("reason"));
        leaveDo.setType(rs.getInt("leaveType"));// does it need to change into integer
        leaveDo.setState(rs.getInt("state"));
        return leaveDo;
    }
}
